home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 296 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: Dick Menninger <Dick.Menninger@daytonoh.attgis.com>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: #ifdef XXXX
  5. Date: 5 Feb 1996 23:31:41 GMT
  6. Organization: AT&T Global Information Solutions
  7. Sender: News administrative Login <news@falcon.daytonoh.attgis.com>
  8. Approved: clamage@eng.sun.com (comp.std.c++)
  9. Message-ID: <DMBrxn.GAB@falcon.daytonoh.attgis.com>
  10. References: <3112531A.3410@ElSegundoCA.ATTGIS.COM>
  11. Reply-To: mennid <Dick.Menninger@daytonoh.attgis.com>
  12. NNTP-Posting-Host: taumet.eng.sun.com
  13. Content-Type: text
  14. X-Nntp-Posting-Host: 149.25.123.146
  15. X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
  16. To: undisclosed-recipients.;@daytonoh.attgis.com
  17. Content-Length: 1546
  18. X-Lines: 44
  19. Originator: clamage@taumet
  20.  
  21.  
  22. > =========="Charles F. McDevitt", 2/2/96==========
  23.  
  24. > Marek MAKOWSKI wrote:
  25.  
  26. > > Would not it be sensible to add to the preprocessing a directive
  27. > > that would stop processing the current file ? Something like
  28.  
  29. > > #ifdef XXXX
  30. > > #exit
  31.  
  32. > > this would safe processing (sometimes very long) file in the common
  33. > > situations:
  34.  
  35. > > #ifdef XXXX
  36. > > // a (possibly) long header file hear
  37. > > #endif  /* ifdef XXXX*/
  38.  
  39.  
  40. > Wouldn't it be better to update the C++ standard so the
  41. > default is that include files only get included once, and the
  42. > compiler/preprocessor keeps track of which ones it's already 
  43. > seen.  Then we wouldn't have to mess with these ugly #ifdefs
  44. > to make include files only be included once.
  45.  
  46. Nothing requires a "header" file to generate the same thing
  47. each time it is included.  For most common uses, that is the
  48. desired semantics, but the current approach allows other
  49. semantic situations to be handled by the existing mechanism
  50. (though the #include is not parameterized, and so "globalish"
  51. name techniques are needed to do other semantics.  But an
  52. include file can be a form of template for source construction
  53. that could be included many times on purpose.  That is what
  54. you are proposing to eliminate.  So you have to debate the
  55. desirability of this style of include file use.  Since C allows it,
  56. this would be a departure in a definite compatibility area.
  57.  
  58. I express no opinion of the desirability of this.  I am merely
  59. trying to clarify the underlying issues.
  60.  
  61. Good Day
  62. Dick
  63. Dick.Menninger@DaytonOH.ATTGIS.COM
  64.  
  65.  
  66. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  67.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  68.   summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  69. ]
  70.